﻿cmake_minimum_required(VERSION 3.15)

project("hello_window_qt")

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY "${_PRJ_TARGET_DIR}/${PROJECT_NAME}")
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${_PRJ_TARGET_DIR}/${PROJECT_NAME}/bin")
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${_PRJ_TARGET_DIR}/${PROJECT_NAME}/lib" )


include_directories(
    ${GLFW3_INCLUDE_DIRS}
    ${GLAD_INCLUDE_DIRS}
)

link_directories(
    ${GLFW3_LIBRARY_DIR}
    ${GLAD_LIBRARY_DIR}
)



file(GLOB HEADERS
    FILE
        "*.h" "*.hh" "*.hpp")
file(GLOB SOURCES
    FILE
        "*.c" "*.cc" "*.cpp")
file(GLOB ASSETS
    FILE
        "*.ui")


set(AllFiles
    ${HEADERS}
    ${SOURCES}
    ${ASSETS}
)

add_executable(${PROJECT_NAME} ${AllFiles})

if(Qt5_FOUND)
    target_link_libraries(${PROJECT_NAME}
        Qt5::Core Qt5::OpenGL Qt5::Network)
else()
    message(FATAL_ERROR "[Error] Qt5 was not found!")
endif()
